package com.ruoyi.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/code")
public class CodeController {


    @GetMapping("/main")
    public String main(String taskId, String token, HttpServletRequest request) {
        System.out.println("taskId:" + taskId);
        System.out.println("token:" + token);
        request.setAttribute("taskId", taskId);
        if (token != null && !"".equals(token) && token.equals("abc")) {
            //转发
            return "/code/task";
        } else {
            //转发
            return "/code/error";
        }
    }

    @GetMapping("/baogong")
    public String baogong(String taskId, Integer taskCount) {
        System.out.println("taskId:" + taskId);
        System.out.println("taskCount:" + taskCount);
        return "/code/success";
    }
}
